package cn.kgc.springboot.controller;

import cn.kgc.springboot.response.ResponseResult;
import cn.kgc.springboot.service.UserService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author 课工场
 * @date 2024/8/15
 * @description
 */
@Controller
@RequestMapping("user")
public class UserController {


    @Resource
    private UserService userService;

    @GetMapping
    public String userView() {
        return "user";
    }

    @GetMapping("page")
    @ResponseBody
    public ResponseResult userPage(Integer page,Integer limit) {
       return userService.userPage(page,limit);
    }
}
